<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h3>工作经历</h3>
    <hr>
    <div id="div1">
        <div id="container">
        </div>
        <p style="text-align: right;"><a href="#"  id="add">添加工作经历</a></p>
    </div>

</body>
<script>
        //获取添加ID
        var add = document.getElementById('add');
        //获取大DIV的id
        var container =document.getElementById('container');

        var node=container.nextSibling;

        add.onclick = function(){
        oDiv = document.createElement('div');
        oDiv.innerHTML = `<div id='container1'>
            公司名称：<input type='text' />
            职位：<input type='text' id='test'> 
            <a href='#' onclick='test(this)'>删除工作经历</a>
            <br />
            <br />
            <table>
            <tr>
                <td align="center">工作职责及工作内容描述:</td>
                <td><textarea name="" id="" cols="90" rows="6"></textarea></td>
            </tr>
            </table>
            <hr>
            </div>`;
        container.parentNode.insertBefore(oDiv, node);
        node=oDiv.nextSibling;
        var divobj1=getElementById('div1');
        var divobj2=divobj1.getElementsByTagName('div');
            for(var i=1;i<divobj2.length;i++){
                var aa='b'+i;
                divobj2[i].setAttribute('id',aa);
            }
        }
        function test(test){
        test.parentNode.parentNode.removeChild(test.parentNode);
        }
            //观看之人此题没做出来
            //观看之人此题没做出来
            //观看之人此题没做出来
    </script>
        
</html>